import {PureComponent} from "react";
import React from "react";
import HeaderComponent from "./header/HeaderComponent";
import {Route} from "react-router-dom";
import {CopyRightComponent} from "./common/CommonUtils";


class HomeComponent extends PureComponent {

    render() {

        let {routes} = this.props;

        return (
            <div style={homeWrapperStyle}>

                <HeaderComponent/>

                <div style={bodyWrapperStyle}>

                       {
                           routes.map((route, key) => {
                               return <Route
                                   key={key}
                                   path={route.path}
                                   component={route.component}
                                   exact={true}
                               />

                           })
                       }

                </div>

                <CopyRightComponent/>
            </div>
        );
    }

}

export default HomeComponent;


const homeWrapperStyle = {
    minWidth: 1200,
    height: '100vh',
    backgroundColor: "#e7ebee",
    display: 'flex',
    flexDirection: 'column',
    justifyContent: "space-between",
};

const bodyWrapperStyle = {
    zIndex: 10,
    flex: 1,
    margin: '10px 20px',

};